import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import PropTypes from 'prop-types'

BottomBtn.propTypes = {
  text: PropTypes.string,
  colorClass: PropTypes.string,
  icon: PropTypes.object.isRequired,
  onBtnClick: PropTypes.func
}

BottomBtn.defaultProps = {
  text: '新建'
}

export default function BottomBtn({ text, colorClass, icon, onBtnClick }) {
  return (
    <button
      style={{width: '100%', height: 55, borderRadius: 0}}
      type='button'
      className={`btn btn-block no-border ${colorClass}`}
      onClick={onBtnClick}
    >
      <FontAwesomeIcon
        style={{marginRight: 10}}
        size='lg'
        icon={ icon } 
      />
      <span>{ text }</span>
    </button>
  )
}
